//    Copyright (C) Kherty.  All rights reserved.
using System;
using OpenLS.Core.Serialization;

namespace OpenLS.Spreadsheet
{
    internal class OleObject : IOfficeXmlSerializable
    {
        private string _progId;
        private DvAspect _dvAspect;
        private string _link;
        private OleUpdate? _oleUpdate;
        private bool _autoLoad;
        private int _shapeId;

        public void ReadXml(ReadContext context)
        {
            using (var c = context.Read("oleObject"))
            {
                _progId = c.GetOptionalString("progId");
                _dvAspect = c.GetOptionalEnum("dvAspect", DvAspect.DVASPECT_CONTENT);
                _link = c.GetOptionalString("link");
                _oleUpdate = c.GetOptionalEnum<OleUpdate>("oleUpdate");
                _autoLoad = c.GetOptionalBoolean("autoLoad", false);
                _shapeId = c.GetUIntegerAsInteger("shapeId");
                string rid = c.GetOptionalString(OfficeConstants.RelationshipNamespace + "id");
                {
                    if (rid != null)
                        throw new NotImplementedException();
                }
            }

        }

        public void WriteXml(WriteContext context)
        {
            throw new NotImplementedException();
        }
    }
}